package sseGameApps.controller.mdkbr.main;

import java.util.HashMap;
import java.util.Map;

import org.slim3.controller.Navigation;
import org.slim3.util.RequestMap;

import sseGameApps.controller.JsonController;
import sseGameApps.model.mdkbr.MdUseKanji;
import sseGameApps.service.mdkbr.MdKanjiService;

public class MdSummonCommitController extends JsonController {

    private MdKanjiService serviceMdKanji = new MdKanjiService();

    @Override
    public Navigation run() throws Exception {
        MdUseKanji mdUsekanji = serviceMdKanji.registMdUseKanji(new RequestMap(request));

        Map<String, String> data = new HashMap<String, String>();

        if (mdUsekanji == null){
            data.put("userId", "");
            this.toJson(data);
        } else {

            data.put("userId", mdUsekanji.getUserId());

            this.toJson(data);
        }

        return null;
    }
}
